home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 9571 < prev    next >
Encoding:
Text File  |  1996-08-05  |  3.6 KB  |  95 lines

  1. Newsgroups: comp.lang.c
  2. Path: oker.escape.de!lst!lst
  3. From: lst@lst.escape.de (Lutz Stohlmann)
  4. Subject: GNU gcc 2.7.2 problem on Intel...
  5. X-Newsreader: TIN [version 1.2 PL2]
  6. Organization: private site lst/bs
  7. Message-ID: <Do3oqx.Fss@lst.escape.de>
  8. Date: Mon, 11 Mar 1996 11:18:32 GMT
  9.  
  10. Hi all,
  11.  
  12. yes, I know, it's a little off-topic and might fit better
  13. in comp.os.linux.* or the like, but as I do not get these
  14. groups I just ask here, so please don't flame:
  15.  
  16. gcc 2.7.2 on i486-linux (1.2.13) problem:
  17. -----------------------------------------
  18.  
  19. I compiled gcc-2.7.2, and with many things I compiled it works.
  20. But when I try to compile the Linux kernel, the compiler cannot
  21. compile the following part of code, esp. the outb inlines:
  22.  
  23. -----------------<SNIP>-----------------------------
  24. extern inline void __outb_p (unsigned   char   value, unsigned short port) 
  25. {  __asm__ __volatile__ ("out" "b" " %"   "b"   "0,%"  "w"  "1" : : "a" (value), "d" (port)); 
  26.    __asm__ __volatile__("outb %al,$0x80")  ; }
  27.  
  28. extern inline void __outbc_p (unsigned   char   value, unsigned short port) 
  29. {  __asm__ __volatile__ ("out" "b" " %" "b" "0,%" "" "1" : : "a" (value), "i" (port));
  30.    __asm__ __volatile__("outb %al,$0x80")  ; }
  31.  
  32. static char fpu_error = 0;
  33.  
  34. static void copro_timeout(void)
  35. {
  36.         fpu_error = 1;
  37.         timer_table[21 ].expires = jiffies+100;
  38.         timer_active |= 1<< 21 ;
  39.         printk("387 failed: trying to reset\n");
  40.         send_sig(8 , last_task_used_math, 1);
  41.         ((__builtin_constant_p(( 0xf1 )) && ( 0xf1 ) < 256) ? __outbc_p(( 0 ),( 
  42. 0xf1 )) : __outb_p(( 0 ),( 0xf1 ))) ;
  43.         ((__builtin_constant_p(( 0xf0 )) && ( 0xf0 ) < 256) ? __outbc_p(( 0 ),( 
  44. 0xf0 )) : __outb_p(( 0 ),( 0xf0 ))) ;
  45. }
  46. -----------------<SNIP>-----------------------------
  47.  
  48. As __outb_p and __outbc_p are made from very ugly #define
  49. macros, I first thought of a cpp problem. But the cpp output
  50. of gcc-2.7.0 and gcc-2.7.2 is exactly the same (but the includes,
  51. of course).
  52.  
  53. Now these are the errors I get:
  54.  
  55. -----------------<SNIP>-----------------------------
  56. /usr/src/linux/include/asm/io.h: In function `copro_timeout':
  57. /usr/src/linux/include/asm/io.h:82: inconsistent operand constraints in an `asm'
  58. /usr/src/linux/include/asm/io.h:82: inconsistent operand constraints in an `asm'
  59. /usr/src/linux/include/asm/io.h:82: inconsistent operand constraints in an `asm'
  60. /usr/src/linux/include/asm/io.h:82: inconsistent operand constraints in an `asm'
  61. ...
  62. make: *** [init/main.o] Error 
  63. -----------------<SNIP>-----------------------------
  64.  
  65. "inconsistent operand contraints in an `asm'".
  66. Ah. Obviously, gcc-2.7.2 doesn't like bytes in outs anymore...
  67.  
  68. gcc on Linux-ELF uses the AT&T assembler syntax, AFAIK.
  69. In that file, every type of a mnemonic like word or double
  70. is defined, but not byte. This is said to be defined in
  71. svr3.h or svr4.h
  72.  
  73. In the Changelog I found:
  74.  
  75. -----------------<SNIP>-----------------------------
  76. Fri Sep 22 18:27:33 1995  Torbjorn Granlund  <tege@matematik.su.se>
  77.  
  78.         * i386.h (CONST_OK_FOR_LETTER_P): Make `N' match range 0..255
  79.         for `outb' instruction.
  80. -----------------<SNIP>-----------------------------
  81.  
  82. Maybe this is the thing which broke outb, as all other out%type%s work?
  83. I think I didn't find differences in the svr4/svr3 files which could
  84. cause this.
  85. Or did the configure command maybe forgot to -Define anything, which
  86. isn't included now and therefore breaks the outb mnemonic?
  87.  
  88. Please reply via email,
  89. thanx in advance for your help.
  90. -- 
  91. Ciao, Lutz                                 ''               live
  92.                         '||  ||` `||''|,   ||  \\  //       free
  93. lst@lst.escape.de        ||  ||   ||  ||   ||    ><          or
  94. T:+491772408889          `|..'|. .||  ||. .||. //  \\       die!
  95.